home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15459 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1014 b 

  1. Path: news.umbc.edu!not-for-mail
  2. From: schlein@umbc.edu (Jonas J. Schlein)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: making #define's to be seen across files
  5. Date: 19 Apr 1996 01:18:32 -0400
  6. Organization: University of Maryland Baltimore County
  7. Message-ID: <4l77n8$pso@umbc9.umbc.edu>
  8. References: <1996Apr9.164443.28709@relay.nswc.navy.mil>
  9. NNTP-Posting-Host: umbc9.umbc.edu
  10. NNTP-Posting-User: schlein
  11.  
  12. |> I have some C code divided into different source files.
  13. |> When I try to compile using 
  14. |>   "cc file1.c file2.c file3.c"
  15. |> the constants #define'd in file1.c are not visible in file2.c, is there a
  16. |> way to make them visible to the other source files?  In other words, is
  17. |> there som equivalent to "extern" for constants?
  18.  
  19. Make a common header file and #include this in all of your other files.
  20. That way they will be visible to all your source files. Sorta like when
  21. you #include <stdio.h> everywhere.
  22. -- 
  23. "If it wasn't for C, we would be using BASI, PASAL, and OBOL."
  24.  
  25. Jonas J. Schlein  (schlein@gl.umbc.edu)
  26.